{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "8b16645d-08bb-4ccb-9295-329f7d04dd0a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "postgresql://hbu:********@127.0.0.1:2345/hbu\n",
      "环境变量加载完成！\n",
      "数据库连接引擎创建成功！\n"
     ]
    }
   ],
   "source": [
    "# 导入必要的库\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import os\n",
    "import sys\n",
    "from sqlalchemy import create_engine\n",
    "import psycopg2\n",
    "from dotenv import load_dotenv\n",
    "\n",
    "# 加载环境变量\n",
    "load_dotenv()\n",
    "\n",
    "# 从环境变量获取数据库连接信息，如果不存在则使用默认值\n",
    "driver=os.getenv('DRIVER', 'postgresql')\n",
    "user=os.getenv('PGUSER', None)\n",
    "password=os.getenv('PGPASSWORD', None)\n",
    "host=os.getenv('PGHOST', None)\n",
    "port=os.getenv('PGPORT', None)\n",
    "database=os.getenv('PGDATABASE', 'postgres')\n",
    "\n",
    "# schema is used for postgres, similiar with database level in MySQL\n",
    "schema=os.getenv('SCHEMA',\"public\")\n",
    "\n",
    "DATABASE_URL = f\"{driver}://{user}:{password}@{host}:{port}/{database}\"\n",
    "\n",
    "if user is not None and password is not None:\n",
    "    print(f\"{driver}://{user}:********@{host}:{port}/{database}\")\n",
    "else:\n",
    "    print('非法的数据库连接URL')\n",
    "    sys.exit(1)\n",
    "print('环境变量加载完成！')\n",
    "\n",
    "# 创建数据库连接引擎\n",
    "try:\n",
    "    engine = create_engine(DATABASE_URL)\n",
    "    print('数据库连接引擎创建成功！')\n",
    "except Exception as e:\n",
    "    print(f'创建数据库连接引擎失败: {e}')\n",
    "    raise\n",
    "# 从PostgreSQL数据库读取数据"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e636ca04-6fff-4f29-8752-246756a78dfc",
   "metadata": {},
   "source": [
    "# 可转债数据一览表\n",
    "**接口**: bond_zh_cov\n",
    "\n",
    "**目标地址**: https://data.eastmoney.com/kzz/default.html\n",
    "\n",
    "**描述**: 东方财富网-数据中心-新股数据-可转债数据一览表\n",
    "\n",
    "**限量**: 单次返回当前交易时刻的所有可转债数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "379d7573-76ba-4b43-98cd-ff05fb782eb8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "25e46b4b00264a36b54a8c68ac31fd61",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/2 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Index(['债券代码', '债券简称', '申购日期', '申购代码', '申购上限', '正股代码', '正股简称', '正股价', '转股价',\n",
      "       '转股价值', '债现价', '转股溢价率', '原股东配售-股权登记日', '原股东配售-每股配售额', '发行规模', '中签号发布日',\n",
      "       '中签率', '上市时间', '信用评级'],\n",
      "      dtype='object')\n",
      "     债券代码   债券简称        申购日期    申购代码        上市时间\n",
      "0  123260   卓镁转债  2025-11-07  371398         NaT\n",
      "1  118059   颀中转债  2025-11-03  718352         NaT\n",
      "2  123259  锦浪转02  2025-10-17  370763  2025-11-06\n",
      "3  110099   福能转债  2025-10-13  733483  2025-10-30\n",
      "4  113699  金25转债  2025-09-26  754979  2025-10-27\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/opt/homebrew/lib/python3.13/site-packages/akshare/bond/bond_zh_cov.py:342: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n",
      "  big_df = pd.concat(objs=[big_df, temp_df], ignore_index=True)\n"
     ]
    }
   ],
   "source": [
    "import akshare as ak\n",
    "# 获取可转债基本信息\n",
    "bond_cov_df = ak.bond_zh_cov()\n",
    "print(bond_cov_df.columns) # 查看所有数据列名\n",
    "print(bond_cov_df[[\"债券代码\", \"债券简称\", \"申购日期\", \"申购代码\", \"上市时间\"]].head())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "2578fe0b-5841-4b38-acef-78c5223688df",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>债券代码</th>\n",
       "      <th>债券简称</th>\n",
       "      <th>申购日期</th>\n",
       "      <th>申购代码</th>\n",
       "      <th>申购上限</th>\n",
       "      <th>正股代码</th>\n",
       "      <th>正股简称</th>\n",
       "      <th>正股价</th>\n",
       "      <th>转股价</th>\n",
       "      <th>转股价值</th>\n",
       "      <th>债现价</th>\n",
       "      <th>转股溢价率</th>\n",
       "      <th>原股东配售-股权登记日</th>\n",
       "      <th>原股东配售-每股配售额</th>\n",
       "      <th>发行规模</th>\n",
       "      <th>中签号发布日</th>\n",
       "      <th>中签率</th>\n",
       "      <th>上市时间</th>\n",
       "      <th>信用评级</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>123260</td>\n",
       "      <td>卓镁转债</td>\n",
       "      <td>2025-11-07</td>\n",
       "      <td>371398</td>\n",
       "      <td>100</td>\n",
       "      <td>301398</td>\n",
       "      <td>星源卓镁</td>\n",
       "      <td>53.01</td>\n",
       "      <td>52.30</td>\n",
       "      <td>101.3576</td>\n",
       "      <td>100.000</td>\n",
       "      <td>-1.34</td>\n",
       "      <td>2025-11-06</td>\n",
       "      <td>4.0178</td>\n",
       "      <td>4.500000</td>\n",
       "      <td>2025-11-11</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaT</td>\n",
       "      <td>A+</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>118059</td>\n",
       "      <td>颀中转债</td>\n",
       "      <td>2025-11-03</td>\n",
       "      <td>718352</td>\n",
       "      <td>100</td>\n",
       "      <td>688352</td>\n",
       "      <td>颀中科技</td>\n",
       "      <td>13.65</td>\n",
       "      <td>13.75</td>\n",
       "      <td>99.2727</td>\n",
       "      <td>100.000</td>\n",
       "      <td>0.73</td>\n",
       "      <td>2025-10-31</td>\n",
       "      <td>0.7200</td>\n",
       "      <td>8.500000</td>\n",
       "      <td>2025-11-05</td>\n",
       "      <td>0.003828</td>\n",
       "      <td>NaT</td>\n",
       "      <td>AA+</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>123259</td>\n",
       "      <td>锦浪转02</td>\n",
       "      <td>2025-10-17</td>\n",
       "      <td>370763</td>\n",
       "      <td>100</td>\n",
       "      <td>300763</td>\n",
       "      <td>锦浪科技</td>\n",
       "      <td>85.69</td>\n",
       "      <td>89.82</td>\n",
       "      <td>95.4019</td>\n",
       "      <td>151.049</td>\n",
       "      <td>58.33</td>\n",
       "      <td>2025-10-16</td>\n",
       "      <td>4.2186</td>\n",
       "      <td>16.765838</td>\n",
       "      <td>2025-10-21</td>\n",
       "      <td>0.005315</td>\n",
       "      <td>2025-11-06</td>\n",
       "      <td>AA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>110099</td>\n",
       "      <td>福能转债</td>\n",
       "      <td>2025-10-13</td>\n",
       "      <td>733483</td>\n",
       "      <td>100</td>\n",
       "      <td>600483</td>\n",
       "      <td>福能股份</td>\n",
       "      <td>10.55</td>\n",
       "      <td>9.84</td>\n",
       "      <td>107.2154</td>\n",
       "      <td>150.501</td>\n",
       "      <td>40.37</td>\n",
       "      <td>2025-10-10</td>\n",
       "      <td>1.3710</td>\n",
       "      <td>38.020000</td>\n",
       "      <td>2025-10-15</td>\n",
       "      <td>0.006033</td>\n",
       "      <td>2025-10-30</td>\n",
       "      <td>AA+</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>113699</td>\n",
       "      <td>金25转债</td>\n",
       "      <td>2025-09-26</td>\n",
       "      <td>754979</td>\n",
       "      <td>100</td>\n",
       "      <td>603979</td>\n",
       "      <td>金诚信</td>\n",
       "      <td>65.40</td>\n",
       "      <td>63.46</td>\n",
       "      <td>103.0570</td>\n",
       "      <td>155.166</td>\n",
       "      <td>50.56</td>\n",
       "      <td>2025-09-25</td>\n",
       "      <td>3.2060</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>2025-09-30</td>\n",
       "      <td>0.006402</td>\n",
       "      <td>2025-10-27</td>\n",
       "      <td>AA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>983</th>\n",
       "      <td>110227</td>\n",
       "      <td>赤化转债</td>\n",
       "      <td>2007-10-10</td>\n",
       "      <td>733227</td>\n",
       "      <td>100</td>\n",
       "      <td>600227</td>\n",
       "      <td>赤天化</td>\n",
       "      <td>2.58</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2007-10-09</td>\n",
       "      <td>2.4000</td>\n",
       "      <td>4.500000</td>\n",
       "      <td>2007-10-16</td>\n",
       "      <td>0.158854</td>\n",
       "      <td>2007-10-23</td>\n",
       "      <td>AAA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>984</th>\n",
       "      <td>126006</td>\n",
       "      <td>07深高债</td>\n",
       "      <td>2007-10-09</td>\n",
       "      <td>733548</td>\n",
       "      <td>100</td>\n",
       "      <td>600548</td>\n",
       "      <td>深高速</td>\n",
       "      <td>10.37</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2007-10-08</td>\n",
       "      <td>1.8000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>2007-10-15</td>\n",
       "      <td>0.290304</td>\n",
       "      <td>2007-10-30</td>\n",
       "      <td>AAA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>985</th>\n",
       "      <td>110971</td>\n",
       "      <td>恒源转债</td>\n",
       "      <td>2007-09-24</td>\n",
       "      <td>733971</td>\n",
       "      <td>100</td>\n",
       "      <td>600971</td>\n",
       "      <td>恒源煤电</td>\n",
       "      <td>7.36</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2007-09-21</td>\n",
       "      <td>1.0000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>2007-09-28</td>\n",
       "      <td>5.311774</td>\n",
       "      <td>2007-10-12</td>\n",
       "      <td>AAA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>986</th>\n",
       "      <td>110567</td>\n",
       "      <td>山鹰转债</td>\n",
       "      <td>2007-09-05</td>\n",
       "      <td>733567</td>\n",
       "      <td>100</td>\n",
       "      <td>600567</td>\n",
       "      <td>山鹰国际</td>\n",
       "      <td>1.79</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2007-09-04</td>\n",
       "      <td>1.1000</td>\n",
       "      <td>4.700000</td>\n",
       "      <td>2007-09-11</td>\n",
       "      <td>0.496391</td>\n",
       "      <td>2007-09-17</td>\n",
       "      <td>AA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>987</th>\n",
       "      <td>110026</td>\n",
       "      <td>中海转债</td>\n",
       "      <td>2007-07-02</td>\n",
       "      <td>733026</td>\n",
       "      <td>100</td>\n",
       "      <td>600026</td>\n",
       "      <td>中远海能</td>\n",
       "      <td>12.68</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100.000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2007-06-29</td>\n",
       "      <td>0.9000</td>\n",
       "      <td>20.000000</td>\n",
       "      <td>2007-07-06</td>\n",
       "      <td>1.333453</td>\n",
       "      <td>2007-07-12</td>\n",
       "      <td>AAA</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>988 rows × 19 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       债券代码   债券简称        申购日期    申购代码  申购上限    正股代码  正股简称    正股价    转股价  \\\n",
       "0    123260   卓镁转债  2025-11-07  371398   100  301398  星源卓镁  53.01  52.30   \n",
       "1    118059   颀中转债  2025-11-03  718352   100  688352  颀中科技  13.65  13.75   \n",
       "2    123259  锦浪转02  2025-10-17  370763   100  300763  锦浪科技  85.69  89.82   \n",
       "3    110099   福能转债  2025-10-13  733483   100  600483  福能股份  10.55   9.84   \n",
       "4    113699  金25转债  2025-09-26  754979   100  603979   金诚信  65.40  63.46   \n",
       "..      ...    ...         ...     ...   ...     ...   ...    ...    ...   \n",
       "983  110227   赤化转债  2007-10-10  733227   100  600227   赤天化   2.58    NaN   \n",
       "984  126006  07深高债  2007-10-09  733548   100  600548   深高速  10.37    NaN   \n",
       "985  110971   恒源转债  2007-09-24  733971   100  600971  恒源煤电   7.36    NaN   \n",
       "986  110567   山鹰转债  2007-09-05  733567   100  600567  山鹰国际   1.79    NaN   \n",
       "987  110026   中海转债  2007-07-02  733026   100  600026  中远海能  12.68    NaN   \n",
       "\n",
       "         转股价值      债现价  转股溢价率 原股东配售-股权登记日  原股东配售-每股配售额       发行规模      中签号发布日  \\\n",
       "0    101.3576  100.000  -1.34  2025-11-06       4.0178   4.500000  2025-11-11   \n",
       "1     99.2727  100.000   0.73  2025-10-31       0.7200   8.500000  2025-11-05   \n",
       "2     95.4019  151.049  58.33  2025-10-16       4.2186  16.765838  2025-10-21   \n",
       "3    107.2154  150.501  40.37  2025-10-10       1.3710  38.020000  2025-10-15   \n",
       "4    103.0570  155.166  50.56  2025-09-25       3.2060  20.000000  2025-09-30   \n",
       "..        ...      ...    ...         ...          ...        ...         ...   \n",
       "983       NaN  100.000    NaN  2007-10-09       2.4000   4.500000  2007-10-16   \n",
       "984       NaN  100.000    NaN  2007-10-08       1.8000  15.000000  2007-10-15   \n",
       "985       NaN  100.000    NaN  2007-09-21       1.0000   4.000000  2007-09-28   \n",
       "986       NaN  100.000    NaN  2007-09-04       1.1000   4.700000  2007-09-11   \n",
       "987       NaN  100.000    NaN  2007-06-29       0.9000  20.000000  2007-07-06   \n",
       "\n",
       "          中签率        上市时间 信用评级  \n",
       "0         NaN         NaT   A+  \n",
       "1    0.003828         NaT  AA+  \n",
       "2    0.005315  2025-11-06   AA  \n",
       "3    0.006033  2025-10-30  AA+  \n",
       "4    0.006402  2025-10-27   AA  \n",
       "..        ...         ...  ...  \n",
       "983  0.158854  2007-10-23  AAA  \n",
       "984  0.290304  2007-10-30  AAA  \n",
       "985  5.311774  2007-10-12  AAA  \n",
       "986  0.496391  2007-09-17   AA  \n",
       "987  1.333453  2007-07-12  AAA  \n",
       "\n",
       "[988 rows x 19 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bond_cov_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ea54c20a-0d8c-46c7-9924-ffd85860f316",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['债券代码', '债券简称', '申购日期', '申购代码', '申购上限', '正股代码', '正股简称', '正股价', '转股价',\n",
       "       '转股价值', '债现价', '转股溢价率', '原股东配售-股权登记日', '原股东配售-每股配售额', '发行规模', '中签号发布日',\n",
       "       '中签率', '上市时间', '信用评级'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bond_cov_df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "6c258f4e-05da-478b-8b3b-12a404d4a44c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "988"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bond_cov_df.to_sql(\n",
    "    name=\"cov_bond_base\",\n",
    "    con=engine,\n",
    "    index=True,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "f2c8e4ee-3cd1-4441-99c1-aef0db2f4748",
   "metadata": {},
   "outputs": [],
   "source": [
    "import akshare as ak\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "599c48bc-e652-49c6-9a3f-0ae8505aaa72",
   "metadata": {},
   "outputs": [],
   "source": [
    "df=ak.bond_zh_hs_cov_daily()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "4f0254a3-9588-41b0-bd36-cb458aa22352",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2001-08-20</td>\n",
       "      <td>101.255</td>\n",
       "      <td>102.835</td>\n",
       "      <td>101.255</td>\n",
       "      <td>102.695</td>\n",
       "      <td>60765500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2001-08-21</td>\n",
       "      <td>102.743</td>\n",
       "      <td>103.213</td>\n",
       "      <td>102.683</td>\n",
       "      <td>103.133</td>\n",
       "      <td>19927710</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2001-08-22</td>\n",
       "      <td>103.332</td>\n",
       "      <td>103.402</td>\n",
       "      <td>103.022</td>\n",
       "      <td>103.222</td>\n",
       "      <td>13132740</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2001-08-23</td>\n",
       "      <td>103.260</td>\n",
       "      <td>103.300</td>\n",
       "      <td>103.080</td>\n",
       "      <td>103.110</td>\n",
       "      <td>9544530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2001-08-24</td>\n",
       "      <td>103.158</td>\n",
       "      <td>103.158</td>\n",
       "      <td>102.908</td>\n",
       "      <td>102.958</td>\n",
       "      <td>7068480</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4801</th>\n",
       "      <td>2021-07-26</td>\n",
       "      <td>100.030</td>\n",
       "      <td>100.060</td>\n",
       "      <td>100.000</td>\n",
       "      <td>100.010</td>\n",
       "      <td>1757900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4802</th>\n",
       "      <td>2021-07-27</td>\n",
       "      <td>100.010</td>\n",
       "      <td>100.030</td>\n",
       "      <td>100.000</td>\n",
       "      <td>100.030</td>\n",
       "      <td>1635540</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4803</th>\n",
       "      <td>2021-07-28</td>\n",
       "      <td>100.010</td>\n",
       "      <td>100.030</td>\n",
       "      <td>100.000</td>\n",
       "      <td>100.020</td>\n",
       "      <td>1425370</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4804</th>\n",
       "      <td>2021-07-29</td>\n",
       "      <td>100.000</td>\n",
       "      <td>100.020</td>\n",
       "      <td>100.000</td>\n",
       "      <td>100.010</td>\n",
       "      <td>244680</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4805</th>\n",
       "      <td>2021-07-30</td>\n",
       "      <td>100.000</td>\n",
       "      <td>100.010</td>\n",
       "      <td>99.990</td>\n",
       "      <td>100.010</td>\n",
       "      <td>150850</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>4806 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            date     open     high      low    close    volume\n",
       "0     2001-08-20  101.255  102.835  101.255  102.695  60765500\n",
       "1     2001-08-21  102.743  103.213  102.683  103.133  19927710\n",
       "2     2001-08-22  103.332  103.402  103.022  103.222  13132740\n",
       "3     2001-08-23  103.260  103.300  103.080  103.110   9544530\n",
       "4     2001-08-24  103.158  103.158  102.908  102.958   7068480\n",
       "...          ...      ...      ...      ...      ...       ...\n",
       "4801  2021-07-26  100.030  100.060  100.000  100.010   1757900\n",
       "4802  2021-07-27  100.010  100.030  100.000  100.030   1635540\n",
       "4803  2021-07-28  100.010  100.030  100.000  100.020   1425370\n",
       "4804  2021-07-29  100.000  100.020  100.000  100.010    244680\n",
       "4805  2021-07-30  100.000  100.010   99.990  100.010    150850\n",
       "\n",
       "[4806 rows x 6 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "d0229bab-e698-4604-a55f-9a760060e864",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['date', 'open', 'high', 'low', 'close', 'volume'], dtype='object')"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "27d7414a-727c-418b-af4e-a5b02bae6c15",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
